package com.njbw.tool;

/**
 * 获取图片路径工具类
 */
public class ImageUtil {

    /**
     * 获取图片域名
     */
    public static String getImageDomain(Long id) {
        String imageDomain = "//njbw/img1.com/pic/";
        try {
            // 相当于一个小负载
            int index = (int) (id % 5);
            switch (index) {
                case 0:
                    imageDomain = "//njbw/img1.com/pic/";
                    break;
                case 1:
                    imageDomain = "//njbw/img2.com/pic/";
                    break;
                case 2:
                    imageDomain = "//njbw/img3.com/pic/";
                    break;
                case 3:
                    imageDomain = "//njbw/img4.com/pic/";
                    break;
                case 4:
                    imageDomain = "//nanjiabawa/img1.com/pic/";
                    break;
                default:
                    imageDomain = "//nanjiabawa/img3.com/pic/";
            }
            imageDomain = "https" + imageDomain;
        } catch (Exception ignore) {
        }
        return imageDomain;
    }
}
